namespace CSharpDay11__Entity_Framework_.Migrations
{
    using CSharpDay11__Entity_Framework_.Models;
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<CSharpDay11__Entity_Framework_.Models.ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(CSharpDay11__Entity_Framework_.Models.ApplicationDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
            context.Artists.AddOrUpdate(x => x.Id,
                new Artist() { Id = 1, Name = "Van Gogh", IsAlive = false, ImageUrl = "http://upload.wikimedia.org/wikipedia/commons/4/4c/Vincent_van_Gogh_-_Self-Portrait_-_Google_Art_Project_(454045).jpg", DateDeleted = null },
                new Artist() { Id = 2, Name = "Michelangelo", IsAlive = false, ImageUrl = "http://a4.files.biography.com/image/upload/c_fill,cs_srgb,dpr_1.0,g_face,h_300,q_80,w_300/MTE1ODA0OTcxNzIzNjIxOTAx.jpg", DateDeleted = null },
                new Artist() { Id = 3, Name = "Raphael", IsAlive = false, ImageUrl = "http://www.artist-biography.info/artist_pictures/raphael.jpg", DateDeleted = null }
                );
            context.ArtWorks.AddOrUpdate(x => x.Id,
                //Van Gogh
                new Artwork() { Id = 1, ArtistId = 1, AwesomenessScale = 10, Worth = 10000000, Title = "The Starry Night", ImageUrl = "http://ih0.redbubble.net/image.12878119.0720/flat,550x550,075,f.u1.jpg", DateDeleted = null },
                new Artwork() { Id = 2, ArtistId = 1, AwesomenessScale = 3, Worth = 30000, Title = "Duke Nukem 3D", ImageUrl = "http://199.101.98.242/media/images/93172-Duke_Nukem_3D_(1996)(3D_Realms)-3.png", DateDeleted = null },
                //Michelangelo
                new Artwork() { Id = 3, ArtistId = 2, AwesomenessScale = 9, Worth = 3250000, Title = "The Feast in the House of Levi", ImageUrl = "http://evergreen.loyola.edu/brnygren/www/Honors/evi.jpg", DateDeleted = null },
                new Artwork() { Id = 4, ArtistId = 2, AwesomenessScale = 10, Worth = 8950001, Title = "Tomb of Pope Julius II: Moses", ImageUrl = "http://www.michelangelo-gallery.org/Tomb-of-Pope-Julius-II--Moses.jpg", DateDeleted = null },
                //Raphael
                new Artwork() { Id = 5, ArtistId = 3, AwesomenessScale = 8, Worth = 2897612, Title = "St George Fighting The Dragon", ImageUrl = "http://www.raphaelsanzio.org/St-George-Fighting-The-Dragon.jpg", DateDeleted = null },
                new Artwork() { Id = 6, ArtistId = 3, AwesomenessScale = 8, Worth = 3125678, Title = "Disputation of the Holy Sacrament", ImageUrl = "http://www.raphaelsanzio.org/Disputation-of-the-Holy-Sacrament-(La-Disputa)-[detail--10a].jpg", DateDeleted = null }
                );
        }
    }
}
